<?php
namespace App\Model;

use PhalApi\Model\NotORMModel as NotORM;

class Demo extends NotORM {
    protected function getTableName($id){
        $tableName = 'demo';
        if($id != null){
            $tableName .= '_' .($id % 3);
        }

        var_dump($tableName);
        return $tableName;
    }

    public function getNameById($id){
        $row = $this->getORM($id)->select('name')->fetchRow();
        return !empty($row) ? $row['name'] : '';
    }
}